import { CardInputTypeEnum } from '@model/enum/CardEnum'
import { ConnectorFromField, ConnectorOptionsAction } from '@src/modules/connector'
import { FromAppData } from '..'

export const generateConvertParams = (
  actionList: ConnectorOptionsAction [], 
  selectFormValue: Record<string, any> | null | undefined, 
  fromAppData: FromAppData,
  fromFields: ConnectorFromField[] )=> {
  const { 
    icon: toBizTypeLogo = '',  
    bizType: toBizType = '', 
    bizTypeId: toBizTypeId = '', 
    label: toBizTypeName = '' 
  } = selectFormValue || {}
  

  const { fromBizType, fromBizTypeId, conditionalLimit } = fromAppData
  return {
    additionalId: -1, // 模拟值
    fromBizType, // 模拟值
    fromBizTypeId,
    fromFieldList: fromFields,
    toFieldList: actionList[0].toRequestFieldList,
    insertFieldOptionsList: [],
    selectFieldOptionsList: [],
    addTime: CardInputTypeEnum.Multi, // 模拟值
    showFieldNameList: [],
    toBizType, 
    toBizTypeLogo, 
    toBizTypeId, 
    toBizTypeName, 
    actionList,
    conditionalLimit,
  }
}